﻿create proc thuan_qtphannhommenu_loadluoinguoidungbymanhom
@MaNhomUser int
as
select CAST(1 as bit) as Chon,a.UserID,a.MaNV,a.TenNV,b.TenPB from 
DanhMuc_NguoiDung a,DanhMuc_PhongBan b
Where a.MaPB=b.MaPB and UserID in (select UserID from QuanTri_PhanNhomNguoiDung Where MaNhomUser=@MaNhomUser)
union
select CAST(0 as bit) as Chon,a.UserID,a.MaNV,a.TenNV,b.TenPB from 
DanhMuc_NguoiDung a,DanhMuc_PhongBan b
Where a.MaPB=b.MaPB and UserID not in (select UserID from QuanTri_PhanNhomNguoiDung Where MaNhomUser=@MaNhomUser)